package brushQuestions.syn;

/**
 * 同步代码块.class方式
 *
 * 锁的是SynCodeBlock类，获得类锁才能访问
 *
 * @author: mengfanbing
 * @date: 2020/5/27 10:32
 */
public class SynCodeBlock {
    public static void testSynCodeBlock() throws InterruptedException {
        synchronized (SynCodeBlock.class){
            System.out.println("我是代码块同步锁.class方式");
            Thread.sleep(2000);
        }
    }
}
